

function say() {
    alert("LC:125. 验证回文串");
}
say();

/**
 * @param {string} s
 * @return {boolean}
 */
var isPalindrome = function (s) {
    //双指针 3:30-45
    var left = 0
    var right = s.length - 1
    while (left <= right) {
        
        var strL = s.charAt(left).toLowerCase()
        var strR = s.charAt(right).toLowerCase()

        var codeL = s.charCodeAt(left)
        var codeR = s.charCodeAt(right)

        if ((codeL >= 'A'.charCodeAt(0) && codeL <= 'Z'.charCodeAt(0)) || (codeL >= 'a'.charCodeAt(0) && codeL <= 'z'.charCodeAt(0) )|| (codeL >= '0'.charCodeAt(0) && codeL <= '9'.charCodeAt(0))){
            if((codeR >= 'A'.charCodeAt(0) && codeR <= 'Z'.charCodeAt(0)) || (codeR >= 'a'.charCodeAt(0) && codeR <= 'z'.charCodeAt(0) )|| (codeR >= '0'.charCodeAt(0) && codeR <= '9'.charCodeAt(0))){
                if(strL == strR){
                    left++
                    right--
                }else {
                    return false
                }
            }else {
                right--
            }
        }else {
            left++
        }
    }
    return true
};
